home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 13 / CU Amiga Magazine's Super CD-ROM 13 (1997)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1997-08].iso / CUCD / Graphics / Ghostscript / batch / ps2pdf < prev    next >
Text File  |  1997-04-12  |  400b  |  23 lines

  1. #!/bin/sh
  2. # Convert PostScript to PDF.
  3.  
  4. infile=$1;
  5.  
  6. if [ $# -eq 1 ]
  7. then
  8.     case "${infile}" in
  9.       *.ps)        base=`basename ${infile} .ps` ;;
  10.       *)        base=`basename ${infile}` ;;
  11.     esac
  12.     outfile=${base}.pdf
  13. else
  14.     outfile=$2
  15. fi
  16.  
  17. if [ $# -lt 1 -o $# -gt 2 ]; then
  18.     echo "Usage: `basename $0` input.ps [output.pdf]" 1>&2
  19.     exit 1
  20. fi
  21.  
  22. exec gs -q -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$outfile $infile -c quit
  23.